import Mock from 'mockjs'
import { login, logout, getUserInfo, getUserMenus } from './login'
import { getTableData, getDragList, uploadImage, getOrgData, getTreeSelectData } from './data'
import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount, addUserMember, getMembereUser, setMembereState, delMemberUser, editMemberUser, getMemberInfo } from './user'
import { uploadAvator, getAccessList, addManageUser, getManageUser, setManageState, delManageUser, editManageUser } from './manage'
import { getMeetDevice, setMeetDeviceState, delMeetDevice, editMeetDevice, addMeetDevice, getMeetRecord, getDeviceArr, addMeetRoom, getMeetRoom, setRoomState, delRoom, editRoom, getMeetDetail, getRoomInfo } from './meet'
import { getOrderCheck, isOrderCheck } from './order'
import { getSystemSetting, setSystemSetting, getSystemLog } from './system'

// 配置Ajax请求延时，可用来测试网络延迟大时项目中一些效果
Mock.setup({
  timeout: 1000
})

// 登录相关和获取用户信息
Mock.mock(/\/login/, login)
Mock.mock(/\/get_info/, getUserInfo)
Mock.mock(/\/get_user_menus/, getUserMenus)
Mock.mock(/\/upload_avator/, uploadAvator)
// manage
Mock.mock(/\/get_access_list/, getAccessList)
Mock.mock(/\/add_manage_user/, addManageUser)
Mock.mock(/\/get_manage_user/, getManageUser)
Mock.mock(/\/set_manage_state/, setManageState)
Mock.mock(/\/del_manage_user/, delManageUser)
Mock.mock(/\/edit_manage_user/, editManageUser)
// member
Mock.mock(/\/add_user_member/, addUserMember)
Mock.mock(/\/get_user_member/, getMembereUser)
Mock.mock(/\/set_member_state/, setMembereState)
Mock.mock(/\/del_member_user/, delMemberUser)
Mock.mock(/\/edit_member_user/, editMemberUser)
Mock.mock(/\/get_member_info/, getMemberInfo)
// meet
Mock.mock(/\/get_meet_device/, getMeetDevice)
Mock.mock(/\/set_meet_device_state/, setMeetDeviceState)
Mock.mock(/\/del_meet_device/, delMeetDevice)
Mock.mock(/\/edit_meet_device/, editMeetDevice)
Mock.mock(/\/add_meet_device/, addMeetDevice)
Mock.mock(/\/get_meet_record/, getMeetRecord)
Mock.mock(/\/get_device_arr/, getDeviceArr)
Mock.mock(/\/add_meet_room/, addMeetRoom)
Mock.mock(/\/get_meet_room/, getMeetRoom)
Mock.mock(/\/set_room_state/, setRoomState)
Mock.mock(/\/del_room/, delRoom)
Mock.mock(/\/edit_room/, editRoom)
Mock.mock(/\/get_meet_detail/, getMeetDetail)
Mock.mock(/\/get_room_info/, getRoomInfo)

Mock.mock(/\/get_order_check/, getOrderCheck)
Mock.mock(/\/is_order_check/, isOrderCheck)
Mock.mock(/\/get_system_setting/, getSystemSetting)
Mock.mock(/\/set_system_setting/, setSystemSetting)
Mock.mock(/\/get_sys_log/, getSystemLog)

Mock.mock(/\/logout/, logout)

// end
Mock.mock(/\/get_table_data/, getTableData)
Mock.mock(/\/get_drag_list/, getDragList)
Mock.mock(/\/save_error_logger/, 'success')
Mock.mock(/\/image\/upload/, uploadImage)
Mock.mock(/\/message\/init/, getMessageInit)
Mock.mock(/\/message\/content/, getContentByMsgId)
Mock.mock(/\/message\/has_read/, hasRead)
Mock.mock(/\/message\/remove_readed/, removeReaded)
Mock.mock(/\/message\/restore/, restoreTrash)
Mock.mock(/\/message\/count/, messageCount)
Mock.mock(/\/get_org_data/, getOrgData)
Mock.mock(/\/get_tree_select_data/, getTreeSelectData)

export default Mock
